import { get, post, put, _delete } from '../lin/plugin/axios'

class FlowModel {
  static async getFlowList() {
    const res = await get('v1/flow')
    return res
  }

  static async addFlow(index, type, art_id, status) {
    const res = await post('v1/flow', {
      index,
      type,
      art_id,
      status
    })
    return res
  }

  static async editFlow(id, index, type, art_id, status) {
    const res = await put(`v1/flow/${id}`, {
      index,
      type,
      art_id,
      status
    })
    return res
  }

  static async delFlow(data) {
    const res = await _delete(`v1/flow/${data.id}`, { type: data.type })
    return res
  }
}

export default FlowModel
